home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: durham.org!stupy
- From: stupy@freenet.durham.org (Steve Tupy)
- Subject: Re: C++ Vs. C & Efficiency
- X-Newsreader: TIN [version 1.2 PL2]
- Organization: Durham Free-Net
- Message-ID: <DLKKB4.Lqu@freenet.durham.org>
- References: <4d59ub$pfg@berlin.infomatch.com>
- Date: Mon, 22 Jan 1996 06:21:04 GMT
-
- Edwin Tam (edwint@infomatch.com) wrote:
- : Hello,
-
- : I have recently become proficient in C++ programming and was wondering about
- : the advantages of C++ vs C. One thing that has always sorta bugged me though
- : the question of the extra overhead required by C++ ( compiler wise ).
- : It seems as if every C++ programmer wants to 'object'ize every thing without
- : considering the overhead incurred by objects.
-
- Very seldom is this the case. A properly well written polymorphic
- heirarchy uses only what it needs, a poorly written one will duplicate data
- and hence memory all over the place. Proper data abstraction is and can be
- quite efficient. The use of virtual bases would apply to just such a case.
-
- : Has anyone got any opinions or idea of the overhead imposed by C++??
- : A simple ponder : For every object instance, every variable of that class is
- : duplicated... even if its not required.
-
- Managability comes to mind before overhead, but as I was saying,
- virtualizing is the answer. If you have only recently become proficient, and
- that interpretation can only be vague at best, perhaps you have not "caught"
- the message yet. Simply writing and deriving classes is definately not the
- heart of C++, polymorphism is... If you are using abstract base classes and
- deriving from virtual bases you are getting closer to the point...
-
- You did ask for an opinion and this is but one of many you may recieve. C++
- can be as tight or as loose as the programmer makes it but isn't it
- wonderful that you have the choice? In "C" you cannot achieve this kind of
- power... sometimes you might have to actually sacrifice some memory for that
- power... something that is less and less of a problem as time goes on.
-
- Take care!
-
- Steve
-
-
- --
- Steve
-